<template>
  <div>

  </div>
</template>

<script>
  import Vue from 'vue'

  export default {
    name: 'entranceWx',
    methods: {

    },
    data() {
      return {

      }
    },
    created() {
      // this.$router.push({
      //   path: "/loanPage/productDetail",
      //   query: {prodId: '447369808172548097', bankReferrer: '29019', networkCode: '010001'}
      // })
      this.$vux.loading.show({
        text: 'Loading'
      })
      this.getQrUserCodeInfo()
    },
    methods: {
      getQrUserCodeInfo() {
        let query = JSON.parse(this.$route.query.scene);
        if (query) {
          this.baseService.postForm(
            this.__ctx + "/qrCode/queryQrCodeInfo", {
              distUserId: query.scene
            }
          ).then((res) => {
            if (res.isOk) {
              this.$router.push({
                path: "/loanPage/productDetail",
                // 机构：orgCode 客户经理工号：handleCode
                query: {prodId: res.data.productId, bankReferrer: res.data.qrcUserSingleImgInfoVo ? res.data.qrcUserSingleImgInfoVo.handleCode : '', networkCode: res.data.qrcUserSingleImgInfoVo ? res.data.qrcUserSingleImgInfoVo.orgCode : ''}
              })
              // sessionStorage.setItem("staffId", res.data.qrcUserSingleImgInfoVo.staffId)
              // if (res.data.productId) {
              //   // this.$router.push({
              //   //   path: res.data.productId,
              //   // })
              // } else {
              //   this.$router.push({
              //     path: "/loanPage/bankEntrance",
              //   })
              // }
              this.$vux.loading.hide()
            }else{
              this.$toast({
                icon: 'warning',
                message: res.msg
              });
              this.$vux.loading.hide()
            }
          }).catch((err) => {
            this.$vux.loading.hide()
          })
        }
      },
    }
  }
</script>

<style scoped>

</style>
